
package com.joysuch.wwyt.bp.enums;

/**
 * 安全生产目标责任状态
 */
public enum TargetResponsibilityTypes {

    TO_BE_AUDITED(0, "TR_TBA", "编制中"),
    AUDIT_WAIT(1, "TR_AW", "等待审核"),
    AUDIT_FAILED(2, "TR_AF", "审核未通过"),
    AUDIT_PASS(3, "TR_AP", "审核通过"),
    EXAM_FAILED(4,"TR_EF", "考核未完成"),
    EXAM_PASS(5, "TR_EP", "考核完成");

    private int id;
    private String code;
    private String name;

    private TargetResponsibilityTypes(int id, String code, String name) {
        this.id = id;
        this.name = name;
        this.code = code;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public static TargetResponsibilityTypes findByName(String name) {
        TargetResponsibilityTypes[] values = TargetResponsibilityTypes.values();
        for (TargetResponsibilityTypes v : values) {
            if (v.getName().equals(name)) {
                return v;
            }
        }
        return null;
    }

    public static TargetResponsibilityTypes findByID(int id) {
        TargetResponsibilityTypes[] values = TargetResponsibilityTypes.values();
        for (TargetResponsibilityTypes v : values) {
            if (v.getId() == id) {
                return v;
            }
        }
        return null;
    }
}
